package com.zpark.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @PackageName: com.zpark.controller
 * @ClassName: TestController
 * @Description:
 * @author: RZS
 * @date: 2024/4/24  8:37
 */
@RestController
@RequestMapping("/test")
// 实时动态刷新配置
@RefreshScope
public class TestController {

    @Value("${user.uname}")
    private String uname;

    @GetMapping("/test")
    public String test(){
        return uname;
    }

    @Value("${spring.datasource.url}")
    private String url;

    @GetMapping("/url")
    public String url(){
        return url;
    }

    @Value("${service-url}")
    private String s_url;

    @GetMapping("/s_url")
    public String sUrl(){
        return s_url;
    }
}
